package com.ruoyi.web.lambda;

/**
 * @Program: RuoYi-Vue-chy->PrintableDemo
 * @Description: 方法引用测试
 * @Author: hongyu.chen
 * @Date: 2025-03-07 20:50
 * @Version： 1.0
 **/
public class PrintableDemo {
    public static void main(String[] args) {

        usePrintable((String s) ->{
            System.out.println(s);
        });
        System.out.println("------------------------------11");
        usePrintable(s -> System.out.println(s));
        System.out.println("------------------------------22");
        //方法引用：::
        usePrintable(System.out::println);

    }

    private static void usePrintable(Printable printable){
        printable.printSting("测试方法引用");
    }
}
